$(function(){
	 $("input[name=background]").bind("tap",changeBackground);
	 
	 var background = window.localStorage.getItem("BACKGROUND");
	 
	 /*设置上次保存背景颜色*/
	 switch(background){
	  case "1":
		  $("#lable1").html("（默认）");
		  $("#lable2").html("");
		  $("#lable3").html("");
		  $("#background1").attr("checked","checked");;
		  break;
	  case "2":
		  $("#lable2").html("（默认）");
		  $("#lable1").html("");
		  $("#lable3").html("");
		  $("#background2").attr("checked","checked");;
		  break;
	  case "3":
		  $("#lable3").html("（默认）");
		  $("#lable1").html("");
		  $("#lable2").html("");
		  $("#background3").attr("checked","checked");;
		  break;
	  default:
		  $("#lable1").html("（默认）");
		  $("#lable2").html("");
		  $("#lable3").html("");
		  $("#background1").attr("checked","checked");;
		  break;
	 }
	 $("#home").bind("tap",toHome);
});

function changeBackground(){
	switch($("input[name=background]:checked").attr("id")){
	  case "background1":
		  background = "1";
		  setbackground("1");
		  $("#lable1").html("（默认）");
		  $("#lable2").html("");
		  $("#lable3").html("");
		  break;
	  case "background2":
		  background = "2";
		  setbackground("2");
		  $("#lable2").html("（默认）");
		  $("#lable1").html("");
		  $("#lable3").html("");
		  break;
	  case "background3":
		  background = "3";
		  setbackground("3");
		  $("#lable3").html("（默认）");
		  $("#lable1").html("");
		  $("#lable2").html("");
		  break;
	  default:
		  break;
	 }
}
function toHome(){
	window.location = "main.html";
}
